package com.yrd.common.handler;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.Callable;
import java.util.concurrent.Future;
import java.util.concurrent.FutureTask;

public class Message {
	static final int TYPE_MESSAGE=0;
	static final int TYPE_RUNNABLE=1;
	static final int TYPE_CALLABLE=2;
	long when;
	Message nextMessage;
	Handler handle;
	int type;
	Runnable runnable;
	Callable<?> callable;
	FutureTask<?> future;
	
	public int what;
	public int arg1;
	public int arg2;
	public Object object;
	public Map<String, Object> data;
	
	Message next(){
		return nextMessage;
	}
	
	public Message() {
		data=new HashMap<String, Object>();
	}
	
	public void sendToTarget(){
		handle.sendMessage(this);
	}


	public Handler getHandle() {
		return handle;
	}


	public void setHandle(Handler handle) {
		this.handle = handle;
	}
	
	
}
